package com.google.mlkit.samples.nl.translate;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

// Create a shared thread pool (singleton pattern)
public class AppExecutor {
//    private static final int THREAD_POOL_SIZE = 1; // Optimal for most devices
    private static final ExecutorService BACKGROUND_EXECUTOR =
//            Executors.newFixedThreadPool(4);
    Executors.newSingleThreadExecutor();

    public static ExecutorService obtain() {
        return BACKGROUND_EXECUTOR;
    }
}